##title=Returns the list of EntitySource objects in the Portal
##parameters=

#grab the KE object catalog for the portal
catalog = context.knowledgeengine_genericobjectcatalogservice

#return the EntityChoosers that use this EntitySource
choosers = []
for catalogObject in catalog(getClassName = 'EntityChooser'):
    choosers.append(catalogObject.getObject())

for catalogObject in catalog(getClassName = 'MultiEntityChooser'):
    choosers.append(catalogObject.getObject())

return choosers or "No choosers found"
